/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.hk.adv.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.hk.sys.entity.user.HkUser;
import org.hibernate.validator.constraints.Length;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 城市广告管理Entity
 * @author 罗天文
 * @version 2018-03-20
 */
public class HkCityAdv extends DataEntity<HkCityAdv> {
	
	private static final long serialVersionUID = 1L;
	private String title;		// 标题
	private String imgSrc;		// 图片
	private String link;		// 链接
	private String note;		// 内容
	private String imgRank;		// 序号
	private String category;		// 所属分类
	private String state;		// 状态
	private String countryId;		// 国家
	private String provinceId;		// 省
	private String cityId;		// 市
	private String integral;		// 积分
	private String goodsIds;		// 物品
	private String tag;		// 标签
	private String manageCategory;		// 管理分类
	private String comment;		// 是否评论
	private Date beginDate;		// 开始时间
	private Date endDate;		// 结束时间
	private String longitude;		// 经度
	private String latitude;		// 纬度
	private String coverImgSrc;		// 封面图片
	private String coverLink;		// 封面图片链接
	private Date beginCreateDate;		// 开始 创建时间
	private Date endCreateDate;		// 结束 创建时间
	private String country;		// 国家
	private String province;		// 省
	private String city;		// 市
	private String  vedioLength;//视频长度
	private String coverImgWidth;		// 封面图片
	private String coverImgHeight;		// 封面图片
	private String isWeb;
	private String aimgSrc;		// 地址
	private HkUser user;  //用户

	public HkUser getUser() {
		return user;
	}

	public void setUser(HkUser user) {
		this.user = user;
	}

	public String getAimgSrc() {
		return aimgSrc;
	}

	public void setAimgSrc(String aimgSrc) {
		this.aimgSrc = aimgSrc;
	}
	public void setCountry(String country) {
		this.country = country;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getIsWeb() {
		return isWeb;
	}

	public void setIsWeb(String isWeb) {
		this.isWeb = isWeb;
	}

	public String getCoverImgWidth() {
		return coverImgWidth;
	}

	public void setCoverImgWidth(String coverImgWidth) {
		this.coverImgWidth = coverImgWidth;
	}

	public String getCoverImgHeight() {
		return coverImgHeight;
	}

	public void setCoverImgHeight(String coverImgHeight) {
		this.coverImgHeight = coverImgHeight;
	}
	public String getVedioLength() {
		return vedioLength;
	}

	public void setVedioLength(String vedioLength) {
		this.vedioLength = vedioLength;
	}
	public String getCountry() {
		return country;
	}



	public String getProvince() {
		return province;
	}



	public String getCity() {
		return city;
	}
	public HkCityAdv() {
		super();
	}

	public HkCityAdv(String id){
		super(id);
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getImgSrc() {
		return imgSrc;
	}

	public void setImgSrc(String imgSrc) {
		this.imgSrc = imgSrc;
	}
	
	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}
	
	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}
	
	public String getImgRank() {
		return imgRank;
	}

	public void setImgRank(String imgRank) {
		this.imgRank = imgRank;
	}
	
	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}
	
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	public String getCountryId() {
		return countryId;
	}

	public void setCountryId(String countryId) {
		this.countryId = countryId;
	}
	
	public String getProvinceId() {
		return provinceId;
	}

	public void setProvinceId(String provinceId) {
		this.provinceId = provinceId;
	}
	
	public String getCityId() {
		return cityId;
	}

	public void setCityId(String cityId) {
		this.cityId = cityId;
	}
	
	public String getIntegral() {
		return integral;
	}

	public void setIntegral(String integral) {
		this.integral = integral;
	}
	
	public String getGoodsIds() {
		return goodsIds;
	}

	public void setGoodsIds(String goodsIds) {
		this.goodsIds = goodsIds;
	}
	
	public String getTag() {
		return tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}
	
	public String getManageCategory() {
		return manageCategory;
	}

	public void setManageCategory(String manageCategory) {
		this.manageCategory = manageCategory;
	}
	
	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	public String getLongitude() {
		return longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}
	
	public String getLatitude() {
		return latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}
	
	public String getCoverImgSrc() {
		return coverImgSrc;
	}

	public void setCoverImgSrc(String coverImgSrc) {
		this.coverImgSrc = coverImgSrc;
	}
	
	public String getCoverLink() {
		return coverLink;
	}

	public void setCoverLink(String coverLink) {
		this.coverLink = coverLink;
	}
	
	public Date getBeginCreateDate() {
		return beginCreateDate;
	}

	public void setBeginCreateDate(Date beginCreateDate) {
		this.beginCreateDate = beginCreateDate;
	}
	
	public Date getEndCreateDate() {
		return endCreateDate;
	}

	public void setEndCreateDate(Date endCreateDate) {
		this.endCreateDate = endCreateDate;
	}

	private List<String> tags;



	public void setTags(List<String> tags) {
		this.tags = tags;
	}


	private List<String> StringToList(String str,List list){
		List<String> roleIdList = Lists.newArrayList();
		if(null!=list)
			roleIdList=list;
		else {
			if(StringUtils.isNotEmpty(str)) {
				roleIdList = Arrays.asList(str.split(","));
			}
		}
		return roleIdList;
	}
	@JsonIgnore
	public List<String> getTags() {


		return StringToList(tag,tags);
	}
}